﻿using _01Net8DependencyInject.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _01Net8DependencyInject.Model
{
    public class ProductService: IProductService
    {
        #region 构造函数
        //public IProductRepository productRepositoy;

        //public ProductService(IProductRepository productRepositoy)
        //{
        //    this.productRepositoy = productRepositoy;
        //}
        #endregion
        #region 接口注册
        //public IProductRepository productRepositoy;

        //public ProductService(IProductRepository productRepositoy)
        //{
        //    this.productRepositoy = productRepositoy;
        //}
        #endregion
        public IProductRepository productRepositoy { get; set; }
        public void GetProduct()
        {
            Console.WriteLine($"查询商品成功，ID{this.GetHashCode()}");
            productRepositoy.GetProductRepository();
        }
    }
}
